import React, { Component } from 'react';
import { Grid } from 'antd-mobile';
import { StyledHotCate } from "./styledHome";
import { withRouter } from "react-router-dom";
@withRouter
class Hotcate extends Component {
  handerClick=(val)=>{
   console.log(val);
  //  this.props.history.push({
  //    pathname:'/list',
  //    state:{
  //      title:val.title
  //    }
  //  })
  this.props.history.push('/list/'+val.title)
  }
  render() {
    return <StyledHotCate>
        <h3>热门分类</h3>
        <Grid data={this.props.arr}
            columnNum={4}
            onClick={this.handerClick}
            renderItem={dataItem => (
                <div className='item-series'>
                  <span>{dataItem.title}</span>
                </div>
            )}
          />
      </StyledHotCate>
    
  }
}

export default Hotcate;
